//
// CParticleSystemModel.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.CRGBA;

public class CParticleSystemModel {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CParticleSystemModel(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CParticleSystemModel obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CParticleSystemModel(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CParticleSystemModel() {
    this(nel3dJNI.new_CParticleSystemModel(), true);
  }

  public static void registerBasic() {
    nel3dJNI.CParticleSystemModel_registerBasic();
  }

  public CParticleSystem getPS() {
    long cPtr = nel3dJNI.CParticleSystemModel_getPS__SWIG_0(swigCPtr, this);
    return (cPtr == 0) ? null : new CParticleSystem(cPtr, false);
  }

  public void setParticleSystem(CParticleSystem ps) {
    nel3dJNI.CParticleSystemModel_setParticleSystem(swigCPtr, this, CParticleSystem.getCPtr(ps), ps);
  }

  public boolean isInvalid() {
    return nel3dJNI.CParticleSystemModel_isInvalid(swigCPtr, this);
  }

  public void registerPSModelObserver(SWIGTYPE_p_NL3D__CParticleSystemModel__IPSModelObserver obs) {
    nel3dJNI.CParticleSystemModel_registerPSModelObserver(swigCPtr, this, SWIGTYPE_p_NL3D__CParticleSystemModel__IPSModelObserver.getCPtr(obs));
  }

  public void removePSModelObserver(SWIGTYPE_p_NL3D__CParticleSystemModel__IPSModelObserver obs) {
    nel3dJNI.CParticleSystemModel_removePSModelObserver(swigCPtr, this, SWIGTYPE_p_NL3D__CParticleSystemModel__IPSModelObserver.getCPtr(obs));
  }

  public boolean isPSModelObserver(SWIGTYPE_p_NL3D__CParticleSystemModel__IPSModelObserver obs) {
    return nel3dJNI.CParticleSystemModel_isPSModelObserver(swigCPtr, this, SWIGTYPE_p_NL3D__CParticleSystemModel__IPSModelObserver.getCPtr(obs));
  }

  public void enableAutoGetEllapsedTime(boolean enable) {
    nel3dJNI.CParticleSystemModel_enableAutoGetEllapsedTime__SWIG_0(swigCPtr, this, enable);
  }

  public void enableAutoGetEllapsedTime() {
    nel3dJNI.CParticleSystemModel_enableAutoGetEllapsedTime__SWIG_1(swigCPtr, this);
  }

  public void setEllapsedTimeRatio(float value) {
    nel3dJNI.CParticleSystemModel_setEllapsedTimeRatio(swigCPtr, this, value);
  }

  public float getEllapsedTimeRatio() {
    return nel3dJNI.CParticleSystemModel_getEllapsedTimeRatio(swigCPtr, this);
  }

  public boolean isAutoGetEllapsedTimeEnabled() {
    return nel3dJNI.CParticleSystemModel_isAutoGetEllapsedTimeEnabled(swigCPtr, this);
  }

  public void setEllapsedTime(float ellapsedTime) {
    nel3dJNI.CParticleSystemModel_setEllapsedTime(swigCPtr, this, ellapsedTime);
  }

  public float getEllapsedTime() {
    return nel3dJNI.CParticleSystemModel_getEllapsedTime(swigCPtr, this);
  }

  public void enableDisplayTools(boolean enable) {
    nel3dJNI.CParticleSystemModel_enableDisplayTools__SWIG_0(swigCPtr, this, enable);
  }

  public void enableDisplayTools() {
    nel3dJNI.CParticleSystemModel_enableDisplayTools__SWIG_1(swigCPtr, this);
  }

  public boolean isToolDisplayEnabled() {
    return nel3dJNI.CParticleSystemModel_isToolDisplayEnabled(swigCPtr, this);
  }

  public void setEditionMode(boolean enable) {
    nel3dJNI.CParticleSystemModel_setEditionMode__SWIG_0(swigCPtr, this, enable);
  }

  public void setEditionMode() {
    nel3dJNI.CParticleSystemModel_setEditionMode__SWIG_1(swigCPtr, this);
  }

  public boolean getEditionMode() {
    return nel3dJNI.CParticleSystemModel_getEditionMode(swigCPtr, this);
  }

  public void touchTransparencyState() {
    nel3dJNI.CParticleSystemModel_touchTransparencyState(swigCPtr, this);
  }

  public void touchLightableState() {
    nel3dJNI.CParticleSystemModel_touchLightableState(swigCPtr, this);
  }

  public IAnimatedValue getValue(long valueId) {
    long cPtr = nel3dJNI.CParticleSystemModel_getValue(swigCPtr, this, valueId);
    return (cPtr == 0) ? null : new IAnimatedValue(cPtr, false);
  }

  public String getValueName(long valueId) {
    return nel3dJNI.CParticleSystemModel_getValueName(swigCPtr, this, valueId);
  }

  public static String getPSParamName(long valueId) {
    return nel3dJNI.CParticleSystemModel_getPSParamName(valueId);
  }

  public ITrack getDefaultTrack(long valueId) {
    long cPtr = nel3dJNI.CParticleSystemModel_getDefaultTrack(swigCPtr, this, valueId);
    return (cPtr == 0) ? null : new ITrack(cPtr, false);
  }

  public void registerToChannelMixer(CChannelMixer chanMixer, String prefix) {
    nel3dJNI.CParticleSystemModel_registerToChannelMixer__SWIG_0(swigCPtr, this, CChannelMixer.getCPtr(chanMixer), chanMixer, prefix);
  }

  public void registerToChannelMixer(CChannelMixer chanMixer) {
    nel3dJNI.CParticleSystemModel_registerToChannelMixer__SWIG_1(swigCPtr, this, CChannelMixer.getCPtr(chanMixer), chanMixer);
  }

  public void bypassGlobalUserParamValue(long userParamIndex, boolean byPass) {
    nel3dJNI.CParticleSystemModel_bypassGlobalUserParamValue__SWIG_0(swigCPtr, this, userParamIndex, byPass);
  }

  public void bypassGlobalUserParamValue(long userParamIndex) {
    nel3dJNI.CParticleSystemModel_bypassGlobalUserParamValue__SWIG_1(swigCPtr, this, userParamIndex);
  }

  public boolean isGlobalUserParamValueBypassed(long userParamIndex) {
    return nel3dJNI.CParticleSystemModel_isGlobalUserParamValueBypassed(swigCPtr, this, userParamIndex);
  }

  public void updateOpacityInfos() {
    nel3dJNI.CParticleSystemModel_updateOpacityInfos(swigCPtr, this);
  }

  public void updateLightingInfos() {
    nel3dJNI.CParticleSystemModel_updateLightingInfos(swigCPtr, this);
  }

  public void getAABBox(SWIGTYPE_p_NLMISC__CAABBox bbox) {
    nel3dJNI.CParticleSystemModel_getAABBox(swigCPtr, this, SWIGTYPE_p_NLMISC__CAABBox.getCPtr(bbox));
  }

  public float getNumTriangles(float distance) {
    return nel3dJNI.CParticleSystemModel_getNumTriangles(swigCPtr, this, distance);
  }

  public static CTransform creator() {
    long cPtr = nel3dJNI.CParticleSystemModel_creator();
    return (cPtr == 0) ? null : new CTransform(cPtr, false);
  }

  public void traverseClip() {
    nel3dJNI.CParticleSystemModel_traverseClip(swigCPtr, this);
  }

  public boolean clip() {
    return nel3dJNI.CParticleSystemModel_clip(swigCPtr, this);
  }

  public void traverseAnimDetail() {
    nel3dJNI.CParticleSystemModel_traverseAnimDetail(swigCPtr, this);
  }

  public void traverseRender() {
    nel3dJNI.CParticleSystemModel_traverseRender(swigCPtr, this);
  }

  public void activateEmitters(boolean active) {
    nel3dJNI.CParticleSystemModel_activateEmitters(swigCPtr, this, active);
  }

  public boolean hasActiveEmitters() {
    return nel3dJNI.CParticleSystemModel_hasActiveEmitters(swigCPtr, this);
  }

  public void setUserColor(CRGBA userColor) {
    nel3dJNI.CParticleSystemModel_setUserColor(swigCPtr, this, CRGBA.getCPtr(userColor), userColor);
  }

  public CRGBA getUserColor() {
    return new CRGBA(nel3dJNI.CParticleSystemModel_getUserColor(swigCPtr, this), true);
  }

  public void setUserMatrix(SWIGTYPE_p_NLMISC__CMatrix userMatrix) {
    nel3dJNI.CParticleSystemModel_setUserMatrix(swigCPtr, this, SWIGTYPE_p_NLMISC__CMatrix.getCPtr(userMatrix));
  }

  public void forceSetUserMatrix(SWIGTYPE_p_NLMISC__CMatrix userMatrix) {
    nel3dJNI.CParticleSystemModel_forceSetUserMatrix(swigCPtr, this, SWIGTYPE_p_NLMISC__CMatrix.getCPtr(userMatrix));
  }

  public SWIGTYPE_p_NLMISC__CMatrix getUserMatrix() {
    return new SWIGTYPE_p_NLMISC__CMatrix(nel3dJNI.CParticleSystemModel_getUserMatrix(swigCPtr, this), false);
  }

  public void forceInstanciate() {
    nel3dJNI.CParticleSystemModel_forceInstanciate(swigCPtr, this);
  }

  public void setZBias(float value) {
    nel3dJNI.CParticleSystemModel_setZBias(swigCPtr, this, value);
  }

  public void stopSound() {
    nel3dJNI.CParticleSystemModel_stopSound(swigCPtr, this);
  }

  public void reactivateSound() {
    nel3dJNI.CParticleSystemModel_reactivateSound(swigCPtr, this);
  }

  public void update() {
    nel3dJNI.CParticleSystemModel_update(swigCPtr, this);
  }

  public final static class TAnimValues {
    public final static TAnimValues OwnerBit = new TAnimValues("OwnerBit", nel3dJNI.CParticleSystemModel_OwnerBit_get());
    public final static TAnimValues PSParam0 = new TAnimValues("PSParam0");
    public final static TAnimValues PSParam1 = new TAnimValues("PSParam1");
    public final static TAnimValues PSParam2 = new TAnimValues("PSParam2");
    public final static TAnimValues PSParam3 = new TAnimValues("PSParam3");
    public final static TAnimValues PSTrigger = new TAnimValues("PSTrigger");
    public final static TAnimValues AnimValueLast = new TAnimValues("AnimValueLast");

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static TAnimValues swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + TAnimValues.class + " with value " + swigValue);
    }

    private TAnimValues(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private TAnimValues(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private TAnimValues(String swigName, TAnimValues swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static TAnimValues[] swigValues = { OwnerBit, PSParam0, PSParam1, PSParam2, PSParam3, PSTrigger, AnimValueLast };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

}
